import path from 'path';
import 'dotenv/config';

export const CWD = process.cwd();

export const {
    SERVER_PORT = 3000, SERVER_TRPC_PREFIX = '/api/trpc', NODE_ENV,
    DEV_PREFIX, PROD_PREFIX, DEV_NEXT_URL = '', DEV_SERVER_URL, PROD_SERVER_URL,
} = process.env || {};

export const PROD = NODE_ENV === 'production';

export const STATIC_PREFIX = '/_next/static';
export const BUILD_ASSETS_PATH = path.join(CWD, '/dist/client/static');
export const PUBLIC_ASSETS_PATH = path.join(CWD, '/public');

export const SERVER_URL = PROD ? PROD_SERVER_URL : DEV_SERVER_URL;
export const PREFIX = PROD ? PROD_PREFIX : DEV_PREFIX;
